package day_2022_9_to_12.Day;

/**
 * @author haomin
 * @date 2022/09/29 22:22
 **/
public class Day28_4_Num168_ConvertToTitle {
    class Solution {
        public String convertToTitle(int n) {
            if(n <= 0) return "";
            StringBuffer sb = new StringBuffer();
            while(n > 0){
                n--;
                sb.append((char)(n % 26 + 'A'));
                n = n / 26;
            }
            return sb.reverse().toString();
        }
    }
}